Using Twixor Compute
When you want to perform any computations in your campaigns using Twixor EnCaps, like performing calculations based on the value given by the customers in EnCap forms, you can call the Twixor Compute engine (Appiyo) using API Node.
Let's use the API Node in the BookStore EnCap for fetching and displaying the details of the customer based on their feedback from the Twixor's BPM engine(i.e. from Appiyo).
For this, let us create and use the button Get Feedback in Thank You message template to get the feedback from the customer.
Then Rating form can be used to get the customer's feedback using Seekbar.
Now place the API Node after the Thank You message template as shown below:
Click in the API node to configure the properties of the API node.
1. Give a name for the API node in Node Name. This name will be used to fetch the result variable from Appiyo.
2. Select the type of API. Choose Twixor Compute API if you want to use the Appiyo data source.
3. Choose the Appiyo data source option.
For this example, let's use the web hook configuration (Connected to Appiyo) called API Node to connect to the Appiyo Data source. To create and configure web hook configurations, refer Webhook Configuration guide.
4. Select the Project created in Appiyo and select the process associated with it.
Creating Process in Appiyo
To create a process in Appiyo for fetching the feedback from the customers, follow the steps below.
1. Go to Appiyo.com.
2. Select your Zone and choose your Project or Process Repository. In this example, a process repository called Process Store is selected.
Refer Create Process Repository section of the Appiyo User Guide to get a detailed view on creating a new process repository.
3. Then select the required process modules from the list. For this example, select a module called User Actions.
Follow the steps illustrated in Modules topic of the Appiyo User Guide to get an assistance on creating Appiyo work flow modules.
4. After the selection of the module, the workflow(s) associated with the project will be rendered in a list.
Create Workflow section will give you a clear idea on creating a new work flow.
Create and select the User Feedback work flow and create a pool or process called Api Node Testing.
Select Task from BPMN Nodes palette and choose Script task option. And then write the script to get the feedback from the customer using Twixor EnCaps.
Let's write a simple script for fetching and displaying the name and phone number of the customers who are giving the feedback through EnCap Forms. Input variables should be same as the field name of the EnCap form controls through which the input is received.
5. After creating the process in Appiyo, go to Twixor EnCaps application and choose the associated Process and Workflow created for the Appiyo Project or Process Repository in the API Node Properties.
6. In order to display the executed result, create a message template called Feedback. The computation output can be retrieved by giving the API node name and output variable scripted in Appiyo in the following format:
{{API node name. output variable}}
After launching the Book Store EnCaps by following the steps depicted in the Launch Configuration, the result obtained from the API node is given below:
In the output shown above, the result statement is fetched and displayed from the output variable defined in Appiyo.
To know more about Appiyo Zones and BPMN Nodes, please refer Appiyo user guide.
Refer Consume Rest APIs guide to consume third-party Rest APIs from your application.